package cn.edu.scau.cmi.chenyipeng.singleton;

public class Chairman {
		private static Chairman instance;
		private String name;
		
		private Chairman(String name) {
			this.name = name;
		}
		
		public static Chairman getInstance(String name) {
			if(instance == null && !name.equals(null)) {
				instance = new Chairman(name);
				
			}
			return instance;
		}
		
		public void setName(String name) {
			this.name = name;
		}
		
		public String getName() {
			return this.name;
		}
		
		public void doSpeech() {
			System.out.println("同志们好");
		}
		
		public String toString() {
			return this.name + super.toString();
		}
}
